<%--
  Created by IntelliJ IDEA.
  User: Soledad
  Date: 2021/12/7
  Time: 22:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <title>食堂点餐系统 | 控制面板</title>
    <jsp:include page="../includes/header.jsp"/>
</head>
<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">

    <jsp:include page="../includes/nav.jsp"/>

    <jsp:include page="../includes/menu.jsp"/>

    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1>购物车结算</h1>
                    </div>
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-right">
                            <li class="breadcrumb-item"><a href="#">主页</a></li>
                            <li class="breadcrumb-item active">用户点餐</li>
                            <li class="breadcrumb-item active">购物车结算</li>
                        </ol>
                    </div>
                </div>
            </div><!-- /.container-fluid -->
        </section>

        <section class="content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-12">

                        <!-- Main content -->
                        <div class="invoice p-3 mb-3">
                            <!-- title row -->
                            <div class="row">
                                <div class="col-12">
                                    <h4>
                                        <i class="fas fa-file-invoice-dollar"></i> 账单信息：
                                    </h4>
                                </div>
                                <!-- /.col -->
                            </div>
                            <!-- info row -->
                            <div class="row invoice-info">
                                <div class="col-sm-4 invoice-col">
                                    用户信息：
                                    <address>
                                        <strong>用户名：${user.username}</strong><br>
                                        用户邮箱：${user.email}<br>
                                        手机号：${user.phone}<br>
                                    </address>
                                </div>
                                <!-- /.col -->
                                <div class="col-sm-4 invoice-col">
                                    餐厅信息：
                                    <address>
                                        <strong>餐厅：紫金运餐厅</strong><br>
                                        餐厅地址：南京工业大学浦江学院紫金运餐厅<br>
                                        联系电话：xxx-xxxx-xxxx<br>
                                    </address>
                                </div>
                                <!-- /.col -->
                                <div class="col-sm-4 invoice-col">
                                    订单信息：
                                    <address>
                                        <strong>订单编号：#0001</strong><br>
                                        座位号：101<br>
                                        <p id="nowtime"/>
                                    </address>
                                </div>
                                <!-- /.col -->
                            </div>
                            <!-- /.row -->

                            <!-- Table row -->
                            <div class="row">
                                <div class="col-12 table-responsive">
                                    <table class="table table-striped">
                                        <thead>
                                        <tr>
                                            <th>序号：</th>
                                            <th>菜品图片：</th>
                                            <th>菜品名称：</th>
                                            <th>菜品属性：</th>
                                            <th>菜品单价：</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr>
                                            <td>1</td>
                                            <td><img src="/static/assets_3.1.0/img/锡纸烤鱼-40.png"/> </td>
                                            <td>锡纸烤鱼</td>
                                            <td>海鲜类</td>
                                            <td>￥64.50</td>
                                        </tr>
                                        <tr>
                                            <td>2</td>
                                            <td><img src="/static/assets_3.1.0/img/蒜香皮皮虾-40.png"/> </td>
                                            <td>蒜香皮皮虾</td>
                                            <td>海鲜类</td>
                                            <td>￥50.00</td>
                                        </tr>
                                        <tr>
                                            <td>3</td>
                                            <td><img src="/static/assets_3.1.0/img/凉拌土豆丝-40.png"/> </td>
                                            <td>凉拌土豆丝</td>
                                            <td>蔬菜类</td>
                                            <td>￥10.70</td>
                                        </tr>
                                        <tr>
                                            <td>4</td>
                                            <td><img src="/static/assets_3.1.0/img/清蒸鲈鱼-40.png"></td>
                                            <td>清蒸鲈鱼</td>
                                            <td>海鲜类</td>
                                            <td>￥25.99</td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <!-- /.col -->
                            </div>
                            <!-- /.row -->

                            <div class="row">
                                <!-- accepted payments column -->
                                <div class="col-6">
                                    <p class="lead">支持以下支付方式:</p>
                                    <i class="fab fa-alipay"></i> 校园卡绑定
                                    <p class="text-muted well well-sm shadow-none" style="margin-top: 10px;">
                                        暂不支持微信支付或银联支付，正在逐步开放中，敬请期待……
                                    </p>
                                </div>
                                <!-- /.col -->
                                <div class="col-6">

                                    <div class="table-responsive">
                                        <table class="table">
                                            <tr>
                                                <th style="width:50%">菜品总价:</th>
                                                <td>￥151.19</td>
                                            </tr>
                                            <tr>
                                                <th>打包费:</th>
                                                <td>￥4</td>
                                            </tr>
                                            <tr>
                                                <th>总金额:</th>
                                                <td>￥155.19</td>
                                            </tr>
                                        </table>
                                    </div>
                                </div>
                                <!-- /.col -->
                            </div>
                            <!-- /.row -->

                            <!-- this row will not appear when printing -->
                            <div class="row no-print">
                                <div class="col-12">
                                    <button type="button" class="btn btn-success float-right"><i class="far fa-credit-card"></i><a>到店取餐</a></button>
                                    <a href="/order/play"><button type="button" class="btn btn-primary float-right" style="margin-right: 5px;">
                                        <i class="far fa-credit-card"></i>外卖配送
                                    </button></a>
                                </div>
                            </div>
                        </div>
                        <!-- /.invoice -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.container-fluid -->
        </section>
        <!-- /.content -->
    </div>
    <jsp:include page="../includes/copyright.jsp"/>

    <!-- Control Sidebar -->
    <aside class="control-sidebar control-sidebar-dark">
        <!-- Control sidebar content goes here -->
    </aside>
    <!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
<jsp:include page="../includes/footer.jsp"/>
<script>
    //页面加载调用
    window.onload=function(){
        //每1秒刷新时间
        setInterval("NowTime()",1000);
    }
    function NowTime(){
        var myDate=new Date();
        var y = myDate.getFullYear();
        var M = myDate.getMonth()+1;     //获取当前月份(0-11,0代表1月)
        var d = myDate.getDate();        //获取当前日(1-31)
        var h = myDate.getHours();       //获取当前小时数(0-23)
        var m = myDate.getMinutes();     //获取当前分钟数(0-59)

        //检查是否小于10
        M=check(M);
        d=check(d);
        h=check(h);
        m=check(m);
        var timestr = y+"-"+M+"-"+d+" "+h+":"+m;
        document.getElementById("nowtime").innerHTML="支付时间：" + timestr;
        document.getElementById("nowtime1").innerHTML="账单日期：" + timestr;
    }
    //时间数字小于10，则在之前加个“0”补位。
    function check(i){
        var num = (i<10)?("0"+i) : i;
        return num;
    }
</script>
</body>
</html>

